<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  <title>AdminLTE 2 | Registration Page</title>
  <!-- Tell the browser to be responsive to screen width -->
  <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport" />
  <!-- Bootstrap 3.3.6 -->
  <link rel="stylesheet" th:href="@{/poemsLife/static/thirdParty/bootstrap/css/bootstrap.min.css}" href="../static/thirdParty/bootstrap/css/bootstrap.min.css" />
  <!-- Font Awesome -->
  <link rel="stylesheet" th:href="@{https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.5.0/css/font-awesome.min.css}" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.5.0/css/font-awesome.min.css" />
  <!-- Ionicons -->
  <link rel="stylesheet" th:href="@{https://cdnjs.cloudflare.com/ajax/libs/ionicons/2.0.1/css/ionicons.min.css}" href="https://cdnjs.cloudflare.com/ajax/libs/ionicons/2.0.1/css/ionicons.min.css" />
  <!-- Theme style -->
  <link rel="stylesheet" th:href="@{/poemsLife/static/thirdParty/dist/css/AdminLTE.min.css}" href="../static/thirdParty/dist/css/AdminLTE.min.css" />
  <!-- iCheck -->
  <link rel="stylesheet" th:href="@{/poemsLife/static/thirdParty/iCheck/square/blue.css}" href="../static/thirdParty/iCheck/square/blue.css" />

</head>
<body class="hold-transition register-page">
<div class="register-box">
  <div class="register-logo">
    <a href="../static/thirdParty/index2.html"><b>Admin</b>LTE</a>
  </div>

  <div class="register-box-body">
    <p class="login-box-msg">Register a new membership</p>

    <form id="registerForm" th:action="@{/admin/account/register}" method="post">
      <div class="form-group has-feedback">
        <input type="text" name="cnName" class="form-control" placeholder="Full name" required="required"/>
        <span class="glyphicon glyphicon-user form-control-feedback"></span>
      </div>
      <div class="form-group has-feedback">
        <input type="email" name="email" class="form-control" placeholder="Email" required="required"/>
        <span class="glyphicon glyphicon-envelope form-control-feedback"></span>
      </div>
      <div class="form-group has-feedback">
        <input type="password" name="password" class="form-control" placeholder="Password" required="required"/>
        <span class="glyphicon glyphicon-lock form-control-feedback"></span>
      </div>
      <div class="form-group has-feedback">
        <input type="password" class="form-control" placeholder="Retype password"/>
        <span class="glyphicon glyphicon-log-in form-control-feedback"></span>
      </div>
      <div class="row">
        <div class="col-xs-8">
          <div class="checkbox icheck">
            <label>
              <input type="checkbox"/> I agree to the <a href="#">terms</a>
            </label>
          </div>
        </div>
        <!-- /.col -->
        <div class="col-xs-4">
          <button type="submit" class="btn btn-primary btn-block btn-flat">Register</button>
        </div>
        <!-- /.col -->
      </div>
    </form>

  </div>
  <!-- /.form-box -->
</div>
<!-- /.register-box -->

<!-- jQuery 2.2.0 -->
<script th:src="@{/poemsLife/static/thirdParty/jQuery-2.2.0.min.js}" src="../static/thirdParty/jQuery-2.2.0.min.js" />
<script th:src="@{/poemsLife/static/thirdParty/jquery.form.js}" src="../static/thirdParty/jquery.form.js" />
<!-- Bootstrap 3.3.6 -->
<script th:src="@{/poemsLife/static/thirdParty/bootstrap/js/bootstrap.min.js}" src="../static/thirdParty/bootstrap/js/bootstrap.min.js" />
<!-- iCheck -->
<script th:src="@{/poemsLife/static/thirdParty/iCheck/icheck.min.js}" src="../static/thirdParty/iCheck/icheck.min.js" />

<script th:src="@{/poemsLife/static/thirdParty/md5.js}" src="../thirdParty/md5.js" />
<script>
  $(function () {
    $('input').iCheck({
      checkboxClass: 'icheckbox_square-blue',
      radioClass: 'iradio_square-blue',
      increaseArea: '20%' // optional
    });
    $("#registerForm").ajaxForm({
      beforeSubmit:function(){
        var pd = $('input[name="password"]').val();
        pd = calcMD5(pd,32);
        $('input[name="password"]').val(pd);
          return true;
        },
      success:function(data) {
        alert("成功注册");
      },
      error: function (xhr, status, error) {
        var result = jQuery.parseJSON(xhr.responseText);
        alert(result.message);
      }
    });


  });
</script>
</body>
</html>
